package patch;

import org.eclipse.emf.common.util.EList;
import org.eclipse.uml2.common.util.CacheAdapter;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.internal.impl.ElementImpl;

@SuppressWarnings("restriction")
public class ElementImpl2 extends ElementImpl {
	
	public static EList<Stereotype> getApplicableStereotypes(Element element) {
		CacheAdapter cache = CacheAdapter.INSTANCE;
		if (cache != null) {
			@SuppressWarnings("unchecked")
			EList<Stereotype> result = (EList<Stereotype>) cache.get(element,
				UMLPackage.Literals.ELEMENT___GET_APPLICABLE_STEREOTYPES);
			if (result == null) {
				cache.put(element,
					UMLPackage.Literals.ELEMENT___GET_APPLICABLE_STEREOTYPES,
					result = ElementOperations2.getApplicableStereotypes(element));
			}
			return result;
		}
		return ElementOperations2.getApplicableStereotypes(element);
	}

}
